home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap10 / HexDump / HexDump.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.0 KB  |  44 lines

  1. //***********************************************************************
  2. //
  3. //  HexDump.cpp
  4. //
  5. //***********************************************************************
  6.  
  7. #include <afxwin.h>
  8. #include "Resource.h"
  9. #include "HexDump.h"
  10. #include "HexDoc.h"
  11. #include "HexView.h"
  12.  
  13. CHexDumpApp myApp;
  14.  
  15. BEGIN_MESSAGE_MAP (CHexDumpApp, CWinApp)
  16.     ON_COMMAND (ID_FILE_OPEN, CWinApp::OnFileOpen)
  17.     ON_COMMAND (ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  18. END_MESSAGE_MAP ()
  19.  
  20. BOOL CHexDumpApp::InitInstance ()
  21. {
  22.     SetRegistryKey ("Programming Windows 95 with MFC");
  23.     LoadStdProfileSettings ();
  24.  
  25.     CSingleDocTemplate* pDocTemplate;
  26.     pDocTemplate = new CSingleDocTemplate (
  27.         IDR_MAINFRAME,
  28.         RUNTIME_CLASS (CHexDoc),
  29.         RUNTIME_CLASS (CFrameWnd),
  30.         RUNTIME_CLASS (CHexView)
  31.     );
  32.  
  33.     AddDocTemplate (pDocTemplate);
  34.  
  35.     CCommandLineInfo cmdInfo;
  36.     ParseCommandLine (cmdInfo);
  37.  
  38.     if (!ProcessShellCommand (cmdInfo))
  39.         return FALSE;
  40.  
  41.     m_pMainWnd->DragAcceptFiles ();
  42.     return TRUE;
  43. }
  44.